import axios from 'axios';

//添加流程
export function doAdd(param) {
    return axios({
        method: 'post',
        url: '/processDefinition/insert',
        data: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}

//编辑流程名称
export function doEdit(param) {
    return axios({
        method: 'post',
        url: '/processDefinition/update',
        data: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}

//删除流程
export function deleteApproval(param) {
    return axios({
        method: 'post',
        url: '/processDefinition/delete',
        data: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}

//获取单据类型
export function getBillType(param) {
    return axios({
        method: 'get',
        url: '/processDefinition/queryBillType',
        params: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}

//分页查询流程定义列表数据
export function getApprovalList(param) {
    return axios({
        method: 'get',
        url: '/processDefinition/list',
        params: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}

//启用停用
export function changeProcessStatus(param) {
    return axios({
        method: 'post',
        url: '/processDefinition/changeProcessStatus',
        data: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}

//数据同步
export function dataSyn(param) {
    return axios({
        method: 'post',
        url: '/baseManager/dataSyn',
        params: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}

//数据是否同步
export function checkIsSyn(param) {
    return axios({
        method: 'get',
        url: '/processDefinition/checkIsBaseDataSyn',
        params: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}

//获取单点登录URL
export function getApprovalUrl(param) {
    return axios({
        method: 'post',
        url: '/processDefinition/getDesignerUrl',
        data: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}

//获取组织信息
export function getOrgUrl(param) {
    return axios({
        method: 'get',
        url: '/organization/getPermOrgByUser',
        params: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}